﻿@using EvertonApp.AdminWeb.Extensions
@model EvertonApp.AdminWeb.Models.ComercioModel

@*<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">*@
    <div class="modal-dialog">
    @using (Ajax.BeginForm("GuardarOferta", "Comercio2", FormMethod.Post, new AjaxOptions { UpdateTargetId = "modalOfertas", OnComplete = "closeModal();" }, new { @id = "formularioModalofertas", enctype = "multipart/form-data" }))
    { 
        @Html.HiddenFor(mod => mod.Id)
        @Html.HiddenFor(mod => mod.desdeFormulario)
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <center><h4 class="modal-title">GESTIÓN OFERTA</h4></center>
            </div>
            <div class="modal-body">
                <center>
                    <div class="modal-body">
@*                        <form class="form-horizontal">*@
                            <div class="form-horizontal">
                            <table>
                            <tr class="form-group">
                                <td>
                                    @Html.Label("Título")
                                </td>
                                <td class="col-lg-9">
                                    @Html.TextBoxFor(mod => mod.TituloOferta, new { id = "TituloOferta", name = "Titulo", @class="form-control expand-input", @value = String.Empty } as object)
                                </td>
                            </tr>
                            <tr class="form-group">
                                <td style="width:40%">
                                    @Html.Label("Fecha Inicio")
                                </td>
                                <td class="col-lg-9" style="width:60%">
                                        @Html.TextBoxFor(mod => mod.FechaInicioOferta, new { id = "FechaInicioOferta", name = "FechaInicio", @class="form-control expand-input",  @value = String.Empty } as object)
                                </td>
                            </tr>
                            <tr class="form-group">
                                <td>
                                    @Html.Label("Fecha Fin")
                                </td>
                                <td class="col-lg-9">
                                    @Html.TextBoxFor(mod => mod.FechaFinOferta, new { id = "FechaFinOferta", name = "FechaFin",@class="form-control expand-input",  @value = String.Empty } as object)
                                </td>
                            </tr>
                            <tr class="form-group">
                                <td> 
                                    @Html.Label("Descripción")
                                </td>
                                <td class="col-lg-9">
                                    @Html.TextAreaFor(mod => mod.DescripcionOferta, new { id = "DescripcionOferta", name = "Descripcion",@class="form-control expand-input",  @value = String.Empty, style="overflow:auto;resize:none" } as object)
                                </td>
                            </tr>
                        </table>
                        </div>
@*                        </form>*@
                    </div>
                </center>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">Guardar</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
            </div>
        </div>
    }
    </div>
@*</div>*@

<script type="text/javascript">
    //$("document").ready(function () {
    //    $('#myModal2').modal('show');
    //});
    function closeModal() {
        $('#modalOfertas').modal('hide');
    }
</script>
